<?php 



$form="fportal_contentlist";
?>
<table>
    <tr valign="top">
        <td>
<div class="cadretop">Copy To</div>
<div class="cadre">


<a onclick="ew_SubmitSelected(document.<?php echo $form; ?>, '<?php echo createRelativeUrl("operation","copy")?>');return false;"  >
<img width="32" border="0" title="Copy" src="./images/copy.png">
</a>
    <?php targetPortal(); ?>    </div>

        </td><td>
<div class="cadretop">Set Tags</div>
<div class="cadre">

<a onclick="ew_SubmitSelected(document.<?php echo $form; ?>, '<?php echo createRelativeUrl("operation","tag")?>');return false;"  >
    <img width="32" border="0" title="Copy" src="./images/tag_content.png">
</a>
<?php 
	$sSql="SELECT name as lib,id as value FROM portal_tags WHERE portalId=".$portalId;

	//echo $sSql;
	?>

<select  title="" name="tags" id="tags" style=" vertical-align: super;">
<option value="none"></option>
<?php

      $rs2=$GLOBALS["conn"]->Execute($sSql); 
		
 while ( !$rs2->EOF)  { 
 	
		  ?>
<option   value="<?php echo $rs2->fields["value"]; ?>"><?php echo $rs2->fields["lib"]; ?></option>

				  <?php
		  $rs2->MoveNext();    
		  }
?>
</select>

</div>
    </td>


        <td>
            <div class="cadretop">Edit Rights</div>
            <div class="cadre">

                <a onclick="ew_SubmitSelected(document.<?php echo $form; ?>, '<?php echo createRelativeUrl("operation","rights")?>');return false;"  >
                    <img width="32" border="0" title="Copy" src="./images/menu/portal_credentials.png">
                </a>

                <?php targetGroups(); ?>



            </div>

        </td>
        </tr>
    </table>

<input type="hidden" name="contenttag" id="contenttag" value="none"/>

<script>
/*
$("a[id=master_portal_contentvalues]").each(function() {
   $(this).parent().parent().remove();
});
*/

$("#<?php echo $form; ?>").append($("#contenttag"));
$("#tags").change(function(){
$("#contenttag").val($(this).val());
		});
</script>


<?php
$GLOBALS["conn"]->BeginTrans();
$sSql="Select * from portal_content where portalId=$portalId";

  $rs=$GLOBALS["conn"]->Execute($sSql);

$groupId=getObjByKey("portal_groups","id","name","Anonymous","portalId",$portalId);
$objectId=getObjByKey("portal_objects","id","name","portal_content");
//echo $groupId." ".$objectId ;
 while ( !$rs->EOF)  {

   $id=$rs->fields["id"];

     $sSql="Insert into portal_credentials values (NULL,,);";
     $GLOBALS["conn"]->Execute($sSql);


     SetRight($id,$objectId,$groupId,"R");

     $rs->MoveNext();
 }

$GLOBALS["conn"]->CommitTrans();

?>



